<?php


class Autoloader
{
    static protected $files = array(
'AjaxController' => 'lib/classes/Controller/AjaxController.class.php',
'Controller' => 'lib/classes/Controller/Controller.interface.php',
'Planet' => 'lib/classes/Models/Phlames/Planet.class.php',
'Sunsystem' => 'lib/classes/Models/Phlames/Sunsystem.class.php',
'User' => 'lib/classes/Models/Phlames/User.class.php',
'PhException' => 'lib/classes/PhException.class.php',
'PhExecutionTimeMeasure' => 'lib/classes/PhExecutionTimeMeasure.class.php',
'PhTemplate' => 'lib/classes/PhTemplate.class.php',
'Template' => 'lib/classes/Template.class.php',
'UnsupportedFeatureException' => 'lib/classes/UnsupportedFeatureException.class.php',
'PlanetOverview' => 'lib/classes/Views/PlanetOverview.class.php',
'SunsystemOverview' => 'lib/classes/Views/SunsystemOverview.class.php',
'UsermenuView' => 'lib/classes/Views/UsermenuView.class.php',
'View' => 'lib/classes/Views/View.interface.class.php',
'exception_error_handler' => 'lib/exception_error_handler.function.php',
'include' => 'lib/include.php',
'Auth' => 'lib/PhlameEngine/Auth.class.php',
'Connection' => 'lib/PhlameEngine/Database/Connection.class.php',
'DatabaseConnection' => 'lib/PhlameEngine/Database/DatabaseConnection.interface.php',
'DatabaseResult' => 'lib/PhlameEngine/Database/DatabaseResult.interface.php',
'DatabaseStatement' => 'lib/PhlameEngine/Database/DatabaseStatement.interface.php',
'DB' => 'lib/PhlameEngine/Database/DB.class.php',
'DBException' => 'lib/PhlameEngine/Database/DBException.class.php',
'DBMySQLi' => 'lib/PhlameEngine/Database/MySQLiConnection/DBMySQLi.class.php',
'MySQLiConnection' => 'lib/PhlameEngine/Database/MySQLiConnection/MySQLiConnection.class.php',
'ResultMySQLi' => 'lib/PhlameEngine/Database/MySQLiConnection/ResultMySQLi.class.php',
'StmtMySQLi' => 'lib/PhlameEngine/Database/MySQLiConnection/StmtMySQLi.class.php',
'SQLException' => 'lib/PhlameEngine/Database/SQLException.class.php',
'StatementException' => 'lib/PhlameEngine/Database/StatementException.class.php',
'InvalidArgumentException' => 'lib/PhlameEngine/InvalidArgumentException.class.php',
'Lang' => 'lib/PhlameEngine/Lang.class.php',
'Login' => 'lib/PhlameEngine/Login.class.php',
'AutoUpdater' => 'lib/PhlameEngine/Mapper/AutoUpdater/AutoUpdater.class.php',
'AutoUpdaterInterface' => 'lib/PhlameEngine/Mapper/AutoUpdater/AutoUpdaterInterface.interface.php',
'Service' => 'lib/PhlameEngine/Mapper/AutoUpdater/Service.class.php',
'AbstractDecoratorFactory' => 'lib/PhlameEngine/Mapper/Factory/AbstractDecoratorFactory.class.php',
'Factory' => 'lib/PhlameEngine/Mapper/Factory/Factory.interface.php',
'MonoFactory' => 'lib/PhlameEngine/Mapper/Factory/MonoFactory.class.php',
'OwnedFactory' => 'lib/PhlameEngine/Mapper/Factory/OwnedFactory.class.php',
'ParentFactory' => 'lib/PhlameEngine/Mapper/Factory/ParentFactory.class.php',
'PropertyFactory' => 'lib/PhlameEngine/Mapper/Factory/PropertyFactory.class.php',
'setOwner' => 'lib/PhlameEngine/Mapper/Factory/setOwner.interface.php',
'Mapper' => 'lib/PhlameEngine/Mapper/Mapper.interface.php',
'MapperRegistry' => 'lib/PhlameEngine/Mapper/MapperRegistry.class.php',
'AbstractPhlame' => 'lib/PhlameEngine/Mapper/Phlame/AbstractPhlame.class.php',
'Phlame' => 'lib/PhlameEngine/Mapper/Phlame/Phlame.interface.php',
'PhlameModule' => 'lib/PhlameEngine/Mapper/Phlame/PhlameModule.class.php',
'TestModule' => 'lib/PhlameEngine/Mapper/Phlame/TestModule.class.php',
'TestPhlame' => 'lib/PhlameEngine/Mapper/Phlame/TestPhlame.class.php',
'Session' => 'lib/PhlameEngine/Session.class.php',
'Validator' => 'lib/PhlameEngine/Validator.class.php'
);
    
    static public function load($classname)
    {
        if (!array_key_exists($classname,self::$files)) {
            throw new AutoloaderException('Class could not be found!');
        }
        require_once(ROOT_PATH.self::$files[$classname]);
    }
}

class AutoloaderException extends ErrorException
{}

spl_autoload_register('Autoloader::load');